from jetcam.jetcam.csi_camera import CSICamera
import cv2

#CSI-0
camera0 = CSICamera(capture_device=0, width=224, height=224)
if not camera0.is_initialized():
     print("Camera 0 initialization failed")
     exit()
while True:
    image0 = camera0.read()
    cv2.imshow("CSI Camera0", image0)

    #image1 = camera1.read()
    #cv2.imshow("CSI Camera1", image1)

    kk = cv2.waitKey(1)
    if kk == ord('q'):  						#按下q键,退出
        break 

cv2.destroyALLWindows()
